#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>

using namespace std;

int main()
{
    string s, b;
    getline(cin, s);
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] != ' ')
            b += s[i];
        else
        {
            b += ' ';
            int j = i;
            while (j < s.size() && s[j] == ' ')
                j++;
            i = j - 1;
        }
    }
    cout << b << endl;
    return 0;
}
